﻿namespace Sidvall.AuthorizationManager.Data.Entity.Entities
{
    public partial class AuthorizationScopeResourceAction : global::Sidvall.Data.DataRowBase, global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction
    {
        #region Public Members

        #region AccessLevel

        private int _AccessLevel;
        public int AccessLevel
        { 
            get
            {
                return _AccessLevel;
            }
            set
            {
                _AccessLevel = value;
            }
        }

        #endregion
        #region Actions

        private string _Actions;
        public string Actions
        { 
            get
            {
                return _Actions;
            }
            set
            {
                _Actions = value;
            }
        }

        #endregion
        #region AuthorizationScopeId

        private long _AuthorizationScopeId;
        public long AuthorizationScopeId
        { 
            get
            {
                return _AuthorizationScopeId;
            }
            set
            {
                _AuthorizationScopeId = value;
            }
        }

        #endregion
        #region AuthorizationScopeResourceActionId

        private long _AuthorizationScopeResourceActionId;
        public long AuthorizationScopeResourceActionId
        { 
            get
            {
                return _AuthorizationScopeResourceActionId;
            }
            set
            {
                _AuthorizationScopeResourceActionId = value;
            }
        }

        #endregion
        #region IsEnabled

        private bool _IsEnabled;
        public bool IsEnabled
        { 
            get
            {
                return _IsEnabled;
            }
            set
            {
                _IsEnabled = value;
            }
        }

        #endregion
        #region Resources

        private string _Resources;
        public string Resources
        { 
            get
            {
                return _Resources;
            }
            set
            {
                _Resources = value;
            }
        }

        #endregion
        #region SubActions

        private string _SubActions;
        public string SubActions
        { 
            get
            {
                return _SubActions;
            }
            set
            {
                _SubActions = value;
            }
        }

        #endregion
        #region ValidForResourceActionItems

        private bool _ValidForResourceActionItems;
        public bool ValidForResourceActionItems
        { 
            get
            {
                return _ValidForResourceActionItems;
            }
            set
            {
                _ValidForResourceActionItems = value;
            }
        }

        #endregion
        
        public virtual Sidvall.AuthorizationManager.Data.Entity.Entities.AuthorizationScope AuthorizationScope { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual System.Collections.Generic.ICollection<Sidvall.AuthorizationManager.Data.Entity.Entities.AuthorizationScopeResourceActionClaim> AuthorizationScopeResourceActionClaim { get; set; }
        
        #region DataRowContextStorageKey

        protected override string DataRowContextStorageKey
        {
            get
            {
                return global::Sidvall.AuthorizationManager.Data.Entity.SystemContext.Current.EntityFacade.AuthorizationScopeResourceActionManager.GetKey(this);
            }
        }

        #endregion
        #region DataRowStateIsDirty

        protected override bool DataRowStateIsDirty
        {
            get
            {
                return global::Sidvall.AuthorizationManager.Data.Entity.SystemContext.Current.EntityFacade.AuthorizationScopeResourceActionManager.DataRowStateIsDirty(this);
            }
        }

        #endregion

        #region IAuthorizationScopeResourceAction Members

        global::Sidvall.AuthorizationManager.Data.ResourceAccessLevel global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.AccessLevel
        {
            get
            {
                return (global::Sidvall.AuthorizationManager.Data.ResourceAccessLevel)this._AccessLevel;
            }
            set
            {
                this.AccessLevel = (int)value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.Actions
        {
            get
            {
                return this._Actions;
            }
            set
            {
                this.Actions = value;
            }
        }
        long global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.AuthorizationScopeId
        {
            get
            {
                return this._AuthorizationScopeId;
            }
            set
            {
                this.AuthorizationScopeId = value;
            }
        }
        System.Nullable<long> global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.AuthorizationScopeResourceActionId
        {
            get
            {
                return this._AuthorizationScopeResourceActionId;
            }
            set
            {
                if (value != null)
                    this.AuthorizationScopeResourceActionId = value.Value;
            }
        }
        bool global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.IsEnabled
        {
            get
            {
                return this._IsEnabled;
            }
            set
            {
                this.IsEnabled = value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.Resources
        {
            get
            {
                return this._Resources;
            }
            set
            {
                this.Resources = value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.SubActions
        {
            get
            {
                return this._SubActions;
            }
            set
            {
                this.SubActions = value;
            }
        }
        bool global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.ValidForResourceActionItems
        {
            get
            {
                return this._ValidForResourceActionItems;
            }
            set
            {
                this.ValidForResourceActionItems = value;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        IAuthorizationScope global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.AuthorizationScope
        {
            get
            {
                return this.AuthorizationScope;
            }
            set
            {
                this.AuthorizationScope = value as AuthorizationScope;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        System.Collections.Generic.IEnumerable<IAuthorizationScopeResourceActionClaim> global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.AuthorizationScopeResourceActionClaims
        {
            get
            {
                return this.AuthorizationScopeResourceActionClaim;
            }
        }
        void global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceAction.SetAuthorizationScopeResourceActionClaims(Sidvall.Data.IDataRowProvider<global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeResourceActionClaim> items)
        {
            this.AuthorizationScopeResourceActionClaim = items as AuthorizationScopeResourceActionClaimCollection;
        }

        #endregion

        #endregion
        #region Constructors

        public AuthorizationScopeResourceAction() : this(false, null, null)
        {
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public AuthorizationScopeResourceAction(bool initializeChildren, Sidvall.Data.IDataRowContextProvider context, Sidvall.Data.DataRowState? dataRowState)
        {
            if ((context != null) || (dataRowState != null))
                SetDataRowContext(context, dataRowState);
            if (initializeChildren)
            {
                this.AuthorizationScopeResourceActionClaim = new System.Collections.Generic.List<AuthorizationScopeResourceActionClaim>();
            }
        }

        #endregion
    }
}